package com.tivyso.testing.mock.generator.componentfilter;

import org.apache.commons.lang.Validate;

/**
 * filters to only class that matches the given classname
 */
public class ClassNameComponentFilter implements IComponentFilter{

	protected final String className;
	
	/**
	 * 
	 * @param className - full classname
	 */
	public ClassNameComponentFilter(String className) {
		Validate.notNull(className);
		this.className = className;
	}
	
	public ClassNameComponentFilter(Class<?> clazz) {
		Validate.notNull(clazz);
		this.className = clazz.getName();
	}

	public boolean match(String className) {
		return className.equals(this.className);
	}

}
